package net.aiion.weave.spi.naming;

import java.lang.annotation.Annotation;
import java.util.Collection;

public interface Context
{
    Class<? extends Annotation> getScope();

    String getId();

    UserContext createUserContext();

    void setParentContext(Context aContext);

    Context getParentContext();

    void detachChildContext(Context aContext);

    void addChildContext(Context aContext);

    Context getChildContextById(String aContextId);

    Collection<Context> getChildContexts();

    Contextual bind(String aContextualName, Object aContextualValue);

    Contextual bind(Contextual aContextual);

    boolean containsBinding(Class<?> aContextualType);

    boolean containsBinding(Class<?> aContextualType, String aContextualName);

    boolean containsBinding(String aContextualName);

    Contextual lookupBinding(Class<?> aContextualType);

    Contextual lookupBinding(Class<?> aContextualType, String aContextualName);

    Contextual lookupBinding(String aContextualName);

    <T> Collection<T> lookupAll(Collection<Class<? extends T>> aContextualTypes);

    <T> T lookup(Class<T> aContextualType);

    <T> T lookup(Class<T> aContextualType, String aContextualName);

    Object lookup(String aContextualName);

    Collection<Contextual> listBindings();

    Collection<Contextual> listBindings(Class<?> aContextualType);

    Collection<Object> list();

    Collection<Object> list(Class<?> aContextualType);

    Contextual unbind(String aContextualName);

    void dispose();
}
